package com.skins.data
{
	import flash.display.DisplayObjectContainer;
	import flash.display.Stage;
	import flash.events.Event;

	/**
	 * ...
	 * @author WZH(shch8.com)
	 */
	public class PhoneInfo 
	{
		
		private static var Instance:PhoneInfo;
		public static function getInstance():PhoneInfo
		{
			if (Instance== null)Instance = new PhoneInfo();
			return Instance;
		}
		
		/**
		 * 开发时使用的默认宽度
		 */
		public var defaultWid:uint = 720;
		
		/**
		 * 开发时使用的默认高度
		 */
		public var defaultHei:uint = 1080;
		
		/**
		 * 屏幕宽度
		 */

		public var scrWidth:uint = 720;
		/**
		 * 宽幕高呀
		 */
		public var scrHeight:uint = 1080;
		/**
		 * 当前舞台，用作弹出框等组件的弹出载体
		 */
		private var _currentStage:DisplayObjectContainer;
		public function set currentStage(value:DisplayObjectContainer):void
		{
			_currentStage = value;
			_currentStage.stage.addEventListener(Event.RESIZE, resizeHandler)
		}
		private function resizeHandler(event:Event):void 
		{	
			var stage:Stage = event.target as Stage;
			scrWidth = stage.stageWidth;
			scrHeight = stage.stageHeight;


		}
		
		public function get currentStage():DisplayObjectContainer
		{
			return _currentStage;
		}
		
		
	}

}